#ifndef WCURL_H
#define WCURL_H
#include <assert.h>
#include <string.h>
#include <curl/curl.h>

using namespace std;

class wcurl
{
public:
    wcurl(const string& uer);
    ~wcurl();
    void reuse();
    const string& header();
    const string& content(bool with_hdr=false);
private:
    void _close();
    static size_t writeCallbackHdr(char* buf, size_t size, size_t nmemb, void* up);
    static size_t writeCallback(char* buf, size_t size, size_t nmemb, void* up);
private:

    string  _url;
    string  _header;
    bool    _used;
    bool    _bscript;
    string  _robots;
    string  _content;
    CURL*   _curl;

public:
    string  _mime;
    string  _date;
};

#endif //WCURL_H
